﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BLL;
using Model;

namespace 超市收银台
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F2)
            {
                txtSearch.Focus();
            }
        }
        private void Search()
        {
            
            txtSearch.Text = "dfdfd";
        }
        private void txtSearch_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F5)
            {
                Search();
            }
            else if (e.KeyCode == Keys.Enter)
            { 
                
            }
        }

        private void txtSearch_TextChanged(object sender, EventArgs e)
        {

        }

        private void btnjiesuan_Click(object sender, EventArgs e)
        {
            Search();
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            SelectGoodsForm2 f = new SelectGoodsForm2();
            f.Show();
            GoodsService gs = new GoodsService();
            string shuju = txtSearch.Text;
            
            dataGridView1.DataSource = new BindingList<GoodsInfo>(gs.SelectGoods(shuju));
            
        }
    }
}
